/*
 * @Description:
 * @Version: 1.0
 * @Author: wen shukai
 * @Date: 2022-06-24 15:43:05
 * @LastEditTime: 2022-06-24 16:04:09
 * @LastEditors: wen shukai
 * @FilePath: \self-taught-js\js字符串常用方法.js
*/
/*******
 * @description:
 * @return {*}获取字符串长度
 */
// const str = 'hello'
// console.log(str.length)
/*******
 * @description:
 * @return {*} 获取字符串指定位置 charAt()
 */
// const str = 'hello'
// console.log(str.charAt(1))
/*******
 * @description:
 * @return {*} incldes()
 */
// let str = 'Hello World'
// console.log(str.includes('o'))
/*******
 * @description:
 * @return {*} concat() 连接多个字符串
 */
// let str = 'abc'
// let str1 = 'qwe'
// console.log(str.concat(str1))
/*******
 * @description:
 * @return {*} split() 字符串分割成数组
 */
// let str = 'abcdef'
// console.log(str.split(''))
/******* 
 * @description: 
 * @return {*} slice()  字符串提取    不会操作原来的字符串
 */
let str = 'abcdefg'
str.slice(0, 2)
console.log(str)
console.log(str.slice(0, 2))